package com.idopartx.phonelightning.service

import android.app.Service
import android.content.Intent
import android.net.Uri
import android.os.Handler
import android.os.IBinder
import android.os.Message
import com.idopartx.phonelightning.utils.SmsObserver

class SmsService : Service() {

    private var smsObserver: SmsObserver? = null


    private val smsHandler = object : Handler() {

        override fun handleMessage(msg: Message) {
            super.handleMessage(msg)

        }
    }


    override fun onCreate() {
        super.onCreate()
        smsObserver = SmsObserver(applicationContext, smsHandler)
        contentResolver.registerContentObserver(Uri.parse("content://sms/"), true, smsObserver!!)
    }

    override fun onBind(intent: Intent?): IBinder? {
        return null
    }
}